have_x11_client = mutter_dep.get_variable('have_x11_client') == 'true'
if have_x11_client or have_x11
x11_dep = dependency('x11')
+ xext_dep = dependency('xext')
xfixes_dep = dependency('xfixes')
endif
libtray = static_library('tray', tray_sources,
c_args: ['-DG_LOG_DOMAIN="notification_area"'],
- dependencies: [mutter_dep, mtk_dep, xfixes_dep],
+ dependencies: [mutter_dep, mtk_dep, xfixes_dep, xext_dep],
include_directories: conf_inc
)
#include "na-xembed.h"
#include <mtk/mtk-x11.h>
+#include <X11/extensions/shape.h>
#include <X11/extensions/Xfixes.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
{
XSetWindowAttributes socket_attrs;
XWindowAttributes plug_attrs;
+ int shape_major, shape_minor;
int result;
result = XGetWindowAttributes (xdisplay, priv->plug_window, &plug_attrs);
priv->plug_window,
priv->socket_window,
0, 0);
+
+ /* Set an empty input shape on the window so that the socket does not
+ * get any input. Without this we the tray may still get events and for
+ * example show tooltips on hover which we don't want.
+ * This is the quickest way to achieve this, without having to deal these
+ * windows with specific code in mutter.
+ */
+ if (XShapeQueryExtension (xdisplay, &shape_major, &shape_minor))
+ {
+ XShapeSelectInput (xdisplay, priv->socket_window, NoEventMask);
+ XShapeCombineRectangles (xdisplay, priv->socket_window, ShapeInput,
+ 0, 0, NULL, 0, ShapeSet, 0);
+ }
}
priv->have_size = FALSE;